package com.xbongbong.paas.feign;


import com.xbongbong.paas.pojo.dto.AttrTrashDeleteDTO;
import com.xbongbong.paas.pojo.dto.FormGetDTO;
import com.xbongbong.paas.pojo.linkdata.LinkDataExplainVO;
import com.xbongbong.paas.pojo.linkdata.dto.LinkDataExplainDTO;
import com.xbongbong.paas.pojo.vo.AttrTrashDeleteVO;
import com.xbongbong.paas.pojo.vo.WorkOrderV2ComboVO;
import com.xbongbong.paas.toolbox.wrap.XbbResponse;
import com.xbongbong.pro.formdata.pojo.dto.FieldExistDataDTO;
import com.xbongbong.pro.formdata.pojo.vo.FieldExistDataVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "xbb-work-order-web", contextId = "workOrderV2ComboFeignClient")
public interface WorkOrderV2ExplainFeignClient {


    /**
     * @Author: wujian
     * @Description: 获取工单特殊下拉
     * @Date: 下午5:10 2022/11/28
     * @Param: [formGetDTO, lang]
     * @return: com.xbongbong.paas.toolbox.wrap.XbbResponse<com.xbongbong.paas.pojo.vo.WorkOrderV2ComboVO>
     **/
    @RequestMapping(value = "/pro/v1/workOrderV2/combo/getItems", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<WorkOrderV2ComboVO> getComboItem(@RequestBody FormGetDTO formGetDTO, @RequestParam("lang") String lang);

    /**
     * 关联数据列表获取字段解释
     * @param linkDataExplainDTO
     * @param lang
     * @return
     */
    @RequestMapping(value = "/pro/v1/workOrderV2/explain/linkData", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<LinkDataExplainVO> getExplain(@RequestBody LinkDataExplainDTO linkDataExplainDTO, @RequestParam("lang") String lang);


    /**
     * 校验字段是否存在
     * @param fieldExistDataDTO
     * @param lang
     * @return
     */
    @RequestMapping(value = "/pro/v1/workOrderV2/formExplain/fieldExistData", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<FieldExistDataVO> fieldExistData(@RequestBody FieldExistDataDTO fieldExistDataDTO, @RequestParam("lang") String lang);

    /**
     * 删除回收站中的字段
     * @param attrTrashDeleteDTO
     * @param lang
     * @return
     */
    @RequestMapping(value = "/pro/v1/workOrderV2/formExplain/trash/delete", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<AttrTrashDeleteVO> trashDelete(@RequestBody AttrTrashDeleteDTO attrTrashDeleteDTO, @RequestParam("lang")  String lang);
}
